Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Runtime.​InteropServices.​GCHandle`1

Assembly: System.Runtime

Represents a strongly typed GC handle to a managed object.

Properties

public bool
IsAllocated
Gets a value that indicates whether this handle has been allocated or not.
public T
Target
Gets or sets the object this handle represents.

Methods

public void
Dispose​()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public bool
Equals​(object obj)
obj The object to compare with the current instance.
Returns <code data-dev-comment-type="langword">true</code> if <code data-dev-comment-type="paramref">obj</code> and this instance are the same type and represent the same value; otherwise, <code data-dev-comment-type="langword">false</code> .
Indicates whether this instance and a specified object are equal.
public bool
Equals​(GCHandle`1 other)
public int
GetHashCode​()
Returns A hash code for the current instance.
Returns the hash code for the current instance.
public string
ToString​()
Inherited from ValueType
Returns The fully qualified type name.
Returns the fully qualified type name of this instance.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .